package handling.mina;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class MapleCodecFactory
        implements ProtocolCodecFactory {

    private final ProtocolEncoder encoder;
    private final ProtocolDecoder decoder;

    public MapleCodecFactory() {
        this.encoder = new MaplePacketEncoder();
        this.decoder = new MaplePacketDecoder();
    }

    public ProtocolEncoder getEncoder() throws Exception {
        return this.encoder;
    }

    public ProtocolDecoder getDecoder() throws Exception {
        return this.decoder;
    }

    /**
     *
     * @param session
     * @return
     * @throws Exception
     */
    @Override
    public ProtocolEncoder getEncoder(IoSession session) throws Exception {
        return this.encoder;
    }

    /**
     *
     * @param session
     * @return
     * @throws Exception
     */
    @Override
    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return this.decoder;
    }
}

/* Location:           C:\Users\文炳\Desktop\CXFBY\114Maplewing.jar
 * Qualified Name:     handling.mina.MapleCodecFactory
 * JD-Core Version:    0.6.2
 */